-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(iOS): added custom URL schemes handling in the AppDelegate
class
#969
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CampioneDev Thanks for the contribution! I have tested it, and it works on my side 👍
Before we merge this PR, we'll need you to do some trivial things:
- Add a change log file: https://github.com/tauri-apps/tao/tree/dev/.changes
- You can find a file in the
.changes
folder as a reference. I think usingpatch
will be enough
- You can find a file in the
- Sign your commit: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
7a548ea
to
7155955
Compare
Thanks! (BTW This is my first PR and contribution to OSS ever... I hope everything's ok, and sorry for the force-pushed mess) |
Package Changes Through 373e133There are 1 changes which include tao with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
I also requested @lucasfernog's review because of his involvement in deep links and as the author of #752 |
Until now, only ["associated domains"](https://developer.apple.com/documentation/xcode/supporting-associated-domains) were handled, using the `application_continue` function, that implements [this Swift method from the `UIApplicationDelegate` class](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623072-application). For [custom URL schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app), I added a new `application_open_url` function that matches the signature of [this other Swift method](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application). Most of the code of the pre-existing `application_continue` has been moved into a separate `handle_deep_link` function so the new `application_open_url` can call it as well. I believe using the same `Event::Opened` event is appropriate in both situations. Since the scheme is part of the URL, a listener can differentiate between them if needed. **Tauri:** since we are emitting the same `Event::Opened` event, this change works automatically with the ["Deep Linking" plugin](https://v2.tauri.app/plugin/deep-linking/) without further modifications. Custom URL schemes in mobile apps are essential, for example, when dealing with OAuth redirect URLs.
Co-authored-by: Jason Tsai <[email protected]>
2946e1a
to
373e133
Compare
your first OSS contribution is a objc-in-rust PR? omg that's impressive |
my first contribution was a dumb issue like "hey you need to fix this typo" people almost deleted my GitHub account 😂 😂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done!
I'll force merge this one but would be great if you could setup commit signing in the future (even for your own personal usage!) |
Until now, only "associated domains" were handled, using the
application_continue
function, implementing this Swift method from theUIApplicationDelegate
class.For custom URL schemes, I added a new
application_open_url
function that implements the signature of this other Swift method.The code of the pre-existing
application_continue
function has been moved into a separatehandle_deep_link
function so the newapplication_open_url
function can call it as well.For now, I believe it's appropriate to use the same
Event::Opened
event in both situations. Since the scheme is part of the URL, a listener can differentiate between them if needed.Tauri: this change works automatically with the "Deep Linking" plugin without further modifications.
Custom URL schemes in mobile apps are essential, for example, when dealing with OAuth redirect URLs.